{{define "index/index.html"}}
<!DOCTYPE html>
<html lang="en">

<head>
    <title>golang wubuze</title>
    <link href="/static/libs/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link href="/static/css/blog-home.css" rel="stylesheet">
    <link href="/static/css/base.css" rel="stylesheet">
</head>

<body>
{{/*<h1>{{.test}}</h1>*/}}
{{/*<h1>{{.name}}</h1>*/}}
{{template "nav.html" .}}

<div class="container">
    <div class="row">

        <div class="col-md-8">
            <section class="article">
                {{range $postkey,$postvalue:=.posts}}
                    <div class="articleInfo">
                    <span>
                        <a class="articleTitle" href="/post/{{$postvalue.Id}}">
                            {{$postvalue.Title}}
                        </a>
                    </span>
                        <span class="createdTime" style="margin-right: 10px;">
                        {{ $postvalue.CreatedAt }}
                    </span>

                    </div>

                    <hr>

                {{end}}
            </section>
            {{if le .pageIndex .totalPage}}
                <ul class="pager">
                    {{if le .pageIndex 1}}
                        <li class="disabled"><a href="#">上一页</a></li>
                    {{else}}
                        <li class=""><a href="{{.path}}?page={{minus .pageIndex 1}}">上一页</a></li>
                    {{end}}
                    <li>{{ .pageIndex }}/ {{ .totalPage }}</li>
                    {{if lt .pageIndex .totalPage }}
                        <li class=""><a href="{{.path}}?page={{add .pageIndex 1}}">下一页</a></li>
                    {{ else}}
                        <li class="disabled"><a href="#">下一页</a></li>
                    {{end}}
                </ul>
            {{end}}




        </div>
    </div>
</div>

</body>
{{end}}